<template>
  <el-dialog title="二维码" :visible.sync="dialogVisible" width="50%">
    <div>
      <canvas ref="Canves" />
    </div>
  </el-dialog>
</template>

<script>
import xxx from 'qrcode'
export default {
  name: '',
  data() {
    return {
      dialogVisible: false
    }
  },
  computed: {},
  created() {},
  methods: {
    text(img) {
      // dialog 内容首次渲染时 dom可能还获取不到就执行了代码,所以使用异步获取
      this.$nextTick(() => {
        xxx.toCanvas(this.$refs.Canves, img, { width: 200, height: 200 })
      })
    }
  }
}
</script>
<style lang="scss" scoped></style>
